package com.erp.erp_servers.warehouse.imp;

import com.erp.erp_dao.warehouse.IPlanInstoreProductDao;
import com.erp.erp_entitys.warehouse.entity.PlanInstoreProductEntity;
import com.erp.erp_servers.warehouse.IPlanInstoreProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : PlanInstoreProductServiceImp
 * @Description : 备货入库产品实现类
 * @Author : lst
 * @Date: 2020-07-06 19:56
 */
@Service
public class PlanInstoreProductServiceImp implements IPlanInstoreProductService {

    /**
     * 备货入库产品接口
     */
    private final IPlanInstoreProductDao planInstoreProductDao;

    @Autowired
    public PlanInstoreProductServiceImp(IPlanInstoreProductDao iPlanInstoreProductDao) {
        this.planInstoreProductDao = iPlanInstoreProductDao;
    }

    /**
     * 备货入库产品批量新增
     * @param products 实例对象集合
     * @return
     */
    @Override
    public int insertPlanInstoreProductList(List<PlanInstoreProductEntity> products) {
        return planInstoreProductDao.insertPlanInstoreProductList(products);
    }

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public PlanInstoreProductEntity queryById(Integer id) {
        return planInstoreProductDao.queryById(id);
    }

    /**
     * 通过实体作为筛选条件查询
     *
     * @param planInstoreProduct 实例对象
     * @return 对象列表
     */
    @Override
    public List<PlanInstoreProductEntity> queryAll(PlanInstoreProductEntity planInstoreProduct) {
        return planInstoreProductDao.queryAll(planInstoreProduct);
    }

    /**
     * 新增数据
     *
     * @param planInstoreProduct 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(PlanInstoreProductEntity planInstoreProduct) {
        return planInstoreProductDao.insert(planInstoreProduct);
    }

    /**
     * 详情批量新增
     * @param list 新增对象集合
     * @return 影响行数
     */
    @Override
    public int addList(List<PlanInstoreProductEntity> list) {
        return planInstoreProductDao.addList(list);
    }

    /**
     * 修改数据
     *
     * @param planInstoreProduct 实例对象
     * @return 影响行数
     */
    @Override
    public int update(PlanInstoreProductEntity planInstoreProduct) {
        return planInstoreProductDao.update(planInstoreProduct);
    }
}
